package clone;

public class test  {
    public static void main(String[] args) throws CloneNotSupportedException {
        Person person1 = new Person(10);
        Person person2 = (Person) person1.clone();
//         浅克隆
//        System.out.println(person1);
//        System.out.println(person2);
//        System.out.println("==========================");
//        person2.setAge(20);
//
//        System.out.println(person1);
//        System.out.println(person2);
//      深克隆
        System.out.println(person1.m.money);
        System.out.println(person2.m.money);
        person2.m.money = 9.9;
        System.out.println("==========================");
        System.out.println(person1.m.money);
        System.out.println(person2.m.money);

    }
}
